[ykj_id].vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  1. <script setup>
  2. import * as echarts from 'echarts'
  3. import request from "~/utils/request";
  4. import {REQUEST} from "~/utils/request";
  5. import {user} from "~/store";
  6. import {useRouter} from "vue-router";
  7. const router = useRouter();
  8. const route = useRoute();
  9. const linkTo = (obj) => {
  10. router.push(obj);
  11. };
  12. let ykj_id = $ref('');
  13. let ykj_name = $ref('');
  14. let sm_id = $ref('');
  15. let subject_id = $ref('')
  16. let school_list = $ref([])
  17. let subject_list = $ref([])
  18. let teacherData = $ref([])
  19. let subjectData = $ref([]);
  20. let barTeacher = $ref([]);
  21. let barPercent = $ref([]);
  22. let barSubject = $ref([]);
  23. let barSubjectData = $ref([]);
  24. let sub_nav = [{
  25. id:'1',
  26. name:'教师批阅情况'
  27. },{
  28. id:'2',
  29. name:'科目批阅进度总览'
  30. }]
  31. let cur_sub = $ref({
  32. id:'1',
  33. name:'教师批阅情况'
  34. })
  35. function getFilterData() {
  36. let data = {
  37. ykj_id: ykj_id
  38. };
  39. request({
  40. url: "/yzy/ksjh/detail",
  41. data: data,
  42. }).then((res) => {
  43. if (res.code === '1') {
  44. subject_list = res.data.one_info.ykj_kskm_ex;
  45. school_list = res.data.one_info.ykj_lkxx_ex;
  46. }
  47. })
  48. }
  49. function getData() {
  50. let data = {
  51. ykj_id: ykj_id,
  52. sm_id: sm_id,
  53. subject_id: subject_id,
  54. };
  55. request({
  56. url: "/yzy/jspyjd/main",
  57. data: data,
  58. }).then((res) => {
  59. if (res.code === '1') {
  60. ykj_name = res.data.data1.ksjh.ykj_ksrwmc;
  61. teacherData = res.data.data1.list;
  62. barTeacher = res.data.data1.users;
  63. barPercent = res.data.data1.values;
  64. barSubject = res.data.data2.users;
  65. barSubjectData = res.data.data2.values;
  66. subjectData = res.data.data2.list;
  67. if (cur_sub.id === '1') {
  68. nextTick(() => {
  69. initChart();
  70. })
  71. } else {
  72. nextTick(() => {
  73. initUnChart();
  74. })
  75. }
  76. }
  77. })
  78. }
  79. function initChart() {
  80. // 基于准备好的dom,初始化echarts实例
  81. let myChart = echarts.init(document.getElementById('barBox'));
  82. myChart.setOption({
  83. tooltip: {
  84. trigger: 'axis',
  85. axisPointer: {
  86. type: 'shadow'
  87. }
  88. },
  89. grid: {
  90. left: '3%',
  91. right: '4%',
  92. bottom: '3%',
  93. containLabel: true
  94. },
  95. xAxis: [
  96. {
  97. type: 'category',
  98. name: '教师',
  99. data: barTeacher,
  100. axisTick: {
  101. alignWithLabel: true
  102. },
  103. }
  104. ],
  105. yAxis: [
  106. {
  107. type: 'value',
  108. name: '扫描进度(%)',
  109. nameTextStyle: {
  110. fontSize: 14
  111. }
  112. }
  113. ],
  114. series: [
  115. {
  116. type: 'bar',
  117. barWidth: '27px',
  118. label: {
  119. show: true,
  120. position: 'top',
  121. color: '#000',
  122. fontSize: 14
  123. },
  124. itemStyle:{
  125. color:'#6897FF',
  126. borderRadius: [16, 16, 0, 0]
  127. },
  128. data: barPercent
  129. }
  130. ]
  131. });
  132. }
  133. function initUnChart() {
  134. // 绘制图表
  135. let myChart_u = echarts.init(document.getElementById('unBox'));
  136. myChart_u.setOption({
  137. tooltip: {
  138. trigger: 'axis',
  139. axisPointer: {
  140. type: 'shadow'
  141. }
  142. },
  143. grid: {
  144. left: '3%',
  145. right: '4%',
  146. bottom: '3%',
  147. containLabel: true
  148. },
  149. xAxis: [
  150. {
  151. type: 'category',
  152. name: '学科',
  153. data: barSubject,
  154. axisTick: {
  155. alignWithLabel: true
  156. },
  157. }
  158. ],
  159. yAxis: [
  160. {
  161. type: 'value',
  162. name: '批阅进度(%)',
  163. nameTextStyle: {
  164. fontSize: 14
  165. }
  166. }
  167. ],
  168. series: [
  169. {
  170. type: 'bar',
  171. barWidth: '27px',
  172. label: {
  173. show: true,
  174. position: 'top',
  175. color: '#000',
  176. fontSize: 14
  177. },
  178. itemStyle:{
  179. color:'#6897FF',
  180. borderRadius: [16, 16, 0, 0]
  181. },
  182. data: barSubjectData
  183. }
  184. ]
  185. });
  186. }
  187. function switchSub(item) {
  188. cur_sub = item;
  189. if(item.id === '1') {
  190. nextTick(()=>{
  191. initChart();
  192. })
  193. } else {
  194. nextTick(()=>{
  195. initUnChart();
  196. })
  197. }
  198. }
  199. onMounted(() => {
  200. if (route.params.ykj_id) {
  201. ykj_id = route.params.ykj_id;
  202. getData();
  203. getFilterData();
  204. }
  205. })
  206. </script>
  207. <route lang="json">
  208. {
  209. "meta":{
  210. "title":"扫描批阅进度",
  211. "breadcrumb":true
  212. }
  213. }
  214. </route>
  215. <template>
  216. <NavHeader/>
  217. <bread-crumb/>
  218. <div class="w-1200px m-auto">
  219. <div class="relative -mt-40px flex justify-end">
  220. <button type="button" class="back-btn" @click="linkTo({name:'process'})">返回</button>
  221. </div>
  222. <div class="mt-10px w-full bg-hex-fff py-20px px-15px">
  223. <h3 class="mb-20px text-16px text-center">{{ykj_name}}</h3>
  224. <ul class="tab-nav m-auto">
  225. <li @click="linkTo({name:'process-smpyjd-ykj_id',params:{ykj_id:ykj_id}})">科目扫描进度</li>
  226. <li @click="linkTo({name:'process-kdsmjd-ykj_id',params:{ykj_id:ykj_id}})">考点扫描进度</li>
  227. <li class="selected">批阅进度</li>
  228. </ul>
  229. <div class="mt-30px flex items-center justify-between">
  230. <div>
  231. <el-select v-model="subject_id" placeholder="全部科目" size="large" @change="getData">
  232. <el-option label="全部" value=""
  233. />
  234. <el-option
  235. v-for="item in subject_list"
  236. :key="item.subject_id"
  237. :label="item.subject_name"
  238. :value="item.subject_id"
  239. />
  240. </el-select>
  241. <el-select class="ml-20px" v-model="sm_id" placeholder="全部学校" size="large" @change="getData">
  242. <el-option label="全部" value=""
  243. />
  244. <el-option
  245. v-for="item in school_list"
  246. :key="item.sm_id"
  247. :label="item.sm_name"
  248. :value="item.sm_id"
  249. />
  250. </el-select>
  251. </div>
  252. <ul class="sub-nav">
  253. <li v-for="item in sub_nav" :class="item.id === cur_sub.id?'selected':''" @click="switchSub(item)">{{item.name}}</li>
  254. </ul>
  255. </div>
  256. <div v-if="cur_sub.id === '1'">
  257. <div id="barBox" style="height: 500px"></div>
  258. <table class="mt-20px data-table" cellpadding="0" cellspacing="0">
  259. <tr>
  260. <th>教师</th>
  261. <th>进度</th>
  262. <th>完成量</th>
  263. <th>总份数</th>
  264. <th>平均分</th>
  265. <th>操作</th>
  266. </tr>
  267. <tr v-for="item in teacherData">
  268. <td>{{item.user_name}}</td>
  269. <td>{{item.jd}}%</td>
  270. <td>{{item.wcl}}</td>
  271. <td>{{item.zfs}}</td>
  272. <td>{{item.pjf}}</td>
  273. <td>
  274. <button type="button" class="op-btn" @click="linkTo({name:'process-pyjd-id-bh',params:{id:ykj_id,bh:item.ysdt_pyyhbh}})">查看详情</button>
  275. </td>
  276. </tr>
  277. </table>
  278. </div>
  279. <div v-else>
  280. <div id="unBox" style="height: 500px"></div>
  281. <table class="mt-20px data-table" cellpadding="0" cellspacing="0">
  282. <tr>
  283. <th>学科</th>
  284. <th>批阅进度</th>
  285. <th>总份数</th>
  286. <th>完成量</th>
  287. <th>标记<br>异常数</th>
  288. <th>平均分</th>
  289. <th>满分</th>
  290. <th>在线人数</th>
  291. <th>操作</th>
  292. </tr>
  293. <tr v-for="item in subjectData">
  294. <td>{{item.xueke}}</td>
  295. <td>{{item.jd}}</td>
  296. <td>{{item.zfs}}</td>
  297. <td>{{item.wcl}}</td>
  298. <td>{{item.ycs}}</td>
  299. <td>{{item.pjf}}</td>
  300. <td>{{item.mf}}</td>
  301. <td>{{item.zxrs}}</td>
  302. <td>
  303. <button type="button" class="op-btn">查看详情</button>
  304. </td>
  305. </tr>
  306. </table>
  307. </div>
  308. </div>
  309. </div>
  310. </template>
  311. <style scoped lang="scss">
  312. $color: #0048e5;
  313. .tab-nav{
  314. width: 457px;
  315. background: #ffffff;
  316. border: 1px solid #dbe7ec;
  317. border-radius: 6px;
  318. display: flex;
  319. align-items: center;
  320. padding: 6px 9px;
  321. li{
  322. width: 140px;
  323. height: 28px;
  324. border-radius: 4px;
  325. font-size: 16px;
  326. color: #666;
  327. text-align: center;
  328. line-height: 28px;
  329. cursor: pointer;
  330. &+li{
  331. margin-left: 10px;
  332. }
  333. &.selected{
  334. background: #e2eaf9;
  335. color: #000;
  336. }
  337. }
  338. }
  339. .data-table {
  340. width: 100%;
  341. table-layout: fixed;
  342. tr:nth-child(even) {
  343. background: #F1F7FF;
  344. }
  345. th {
  346. height: 74px;
  347. background: $color;
  348. font-weight: normal;
  349. text-align: center;
  350. font-size: 16px;
  351. color: #fff;
  352. &:first-child{
  353. border-radius: 6px 0 0 0;
  354. }
  355. &:last-child{
  356. border-radius: 0 6px 0 0;
  357. }
  358. }
  359. td {
  360. padding: 15px 0;
  361. font-size: 16px;
  362. color: #474747;
  363. text-align: center;
  364. }
  365. }
  366. .no-data {
  367. width: 100%;
  368. height: 450px;
  369. display: flex;
  370. justify-content: center;
  371. align-items: center;
  372. .no-data-img {
  373. width: 233px;
  374. height: 199px;
  375. background: url("/images/no-data.png") center no-repeat;
  376. }
  377. }
  378. .op-btn {
  379. width: 82px;
  380. height: 30px;
  381. background: #fff;
  382. border: 1px solid #003eee;
  383. border-radius: 2px;
  384. font-size: 14px;
  385. color: #003eee;
  386. text-align: center;
  387. &:disabled{
  388. background: #ccc;
  389. border-color: #ccc;
  390. color: #fff;
  391. pointer-events: none;
  392. }
  393. }
  394. .sub-nav{
  395. width: 280px;
  396. height: 30px;
  397. display: flex;
  398. li{
  399. width: 50%;
  400. background: #ffffff;
  401. font-size: 16px;
  402. color: #000;
  403. border: 1px solid #dbe7ec;
  404. line-height: 28px;
  405. text-align: center;
  406. cursor: pointer;
  407. &.selected{
  408. border-radius: 4px!important;
  409. background:#003eee;
  410. border-color: #003eee;
  411. color: #fff;
  412. }
  413. &:first-child{
  414. border-right: 0;
  415. border-radius: 4px 0 0 4px;
  416. }
  417. &:last-child{
  418. border-left: 0;
  419. border-radius: 0 4px 4px 0;
  420. }
  421. }
  422. }
  423. </style>